package org.admanager.piadladmapping.plugin.diagram.part;

import java.util.Collections;
import java.util.List;

import org.admanager.piadladmapping.plugin.diagram.providers.PiADLADManagementMetamodelElementTypes;
import org.eclipse.gef.Tool;
import org.eclipse.gef.palette.PaletteContainer;
import org.eclipse.gef.palette.PaletteDrawer;
import org.eclipse.gef.palette.PaletteRoot;
import org.eclipse.gef.palette.ToolEntry;
import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeConnectionTool;
import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeCreationTool;

/**
 * @generated
 */
public class PiADLADManagementMetamodelPaletteFactory {

	/**
	 * @generated
	 */
	public void fillPalette(PaletteRoot paletteRoot) {
		paletteRoot.add(createMappingelement1Group());
		paletteRoot.add(createRelationship2Group());
	}

	/**
	 * Creates "Mapping element" palette tool group
	 * @generated
	 */
	private PaletteContainer createMappingelement1Group() {
		PaletteDrawer paletteContainer = new PaletteDrawer(
				Messages.Mappingelement1Group_title);
		paletteContainer.setId("createMappingelement1Group"); //$NON-NLS-1$
		paletteContainer.add(createComponentMapping1CreationTool());
		paletteContainer.add(createConnectorMapping2CreationTool());
		paletteContainer.add(createComponentPortMapping3CreationTool());
		paletteContainer.add(createConnectorRoleMapping4CreationTool());
		return paletteContainer;
	}

	/**
	 * Creates "Relationship" palette tool group
	 * @generated
	 */
	private PaletteContainer createRelationship2Group() {
		PaletteDrawer paletteContainer = new PaletteDrawer(
				Messages.Relationship2Group_title);
		paletteContainer.setId("createRelationship2Group"); //$NON-NLS-1$
		paletteContainer.add(createComponentMappingSource1CreationTool());
		paletteContainer.add(createComponentMappingTarget2CreationTool());
		paletteContainer.add(createConnectorMappingSource3CreationTool());
		paletteContainer.add(createConnectorMappingTarget4CreationTool());
		paletteContainer.add(createComponentPortMappingSource5CreationTool());
		paletteContainer.add(createComponentPortMappingTarget6CreationTool());
		paletteContainer.add(createConnectorRoleMappingSource7CreationTool());
		paletteContainer.add(createConnectorRoleMappingTarget8CreationTool());
		return paletteContainer;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentMapping1CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.ComponentMapping1CreationTool_title,
				Messages.ComponentMapping1CreationTool_desc,
				Collections
						.singletonList(PiADLADManagementMetamodelElementTypes.ComponentMapping_2033));
		entry.setId("createComponentMapping1CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(PiADLADManagementMetamodelElementTypes
				.getImageDescriptor(PiADLADManagementMetamodelElementTypes.ComponentMapping_2033));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createConnectorMapping2CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.ConnectorMapping2CreationTool_title,
				Messages.ConnectorMapping2CreationTool_desc,
				Collections
						.singletonList(PiADLADManagementMetamodelElementTypes.ConnectorMapping_2032));
		entry.setId("createConnectorMapping2CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(PiADLADManagementMetamodelElementTypes
				.getImageDescriptor(PiADLADManagementMetamodelElementTypes.ConnectorMapping_2032));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentPortMapping3CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.ComponentPortMapping3CreationTool_title,
				Messages.ComponentPortMapping3CreationTool_desc,
				Collections
						.singletonList(PiADLADManagementMetamodelElementTypes.ComponentPortMapping_2030));
		entry.setId("createComponentPortMapping3CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(PiADLADManagementMetamodelElementTypes
				.getImageDescriptor(PiADLADManagementMetamodelElementTypes.ComponentPortMapping_2030));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createConnectorRoleMapping4CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.ConnectorRoleMapping4CreationTool_title,
				Messages.ConnectorRoleMapping4CreationTool_desc,
				Collections
						.singletonList(PiADLADManagementMetamodelElementTypes.ConnectorRoleMapping_2031));
		entry.setId("createConnectorRoleMapping4CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(PiADLADManagementMetamodelElementTypes
				.getImageDescriptor(PiADLADManagementMetamodelElementTypes.ConnectorRoleMapping_2031));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentMappingSource1CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ComponentMappingSource1CreationTool_title,
				Messages.ComponentMappingSource1CreationTool_desc,
				Collections
						.singletonList(PiADLADManagementMetamodelElementTypes.ComponentMappingSource_4046));
		entry.setId("createComponentMappingSource1CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(PiADLADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.piadladmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(PiADLADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.piadladmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentMappingTarget2CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ComponentMappingTarget2CreationTool_title,
				Messages.ComponentMappingTarget2CreationTool_desc,
				Collections
						.singletonList(PiADLADManagementMetamodelElementTypes.ComponentMappingTarget_4048));
		entry.setId("createComponentMappingTarget2CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(PiADLADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.piadladmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(PiADLADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.piadladmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createConnectorMappingSource3CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ConnectorMappingSource3CreationTool_title,
				Messages.ConnectorMappingSource3CreationTool_desc,
				Collections
						.singletonList(PiADLADManagementMetamodelElementTypes.ConnectorMappingSource_4044));
		entry.setId("createConnectorMappingSource3CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(PiADLADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.piadladmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(PiADLADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.piadladmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createConnectorMappingTarget4CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ConnectorMappingTarget4CreationTool_title,
				Messages.ConnectorMappingTarget4CreationTool_desc,
				Collections
						.singletonList(PiADLADManagementMetamodelElementTypes.ConnectorMappingTarget_4043));
		entry.setId("createConnectorMappingTarget4CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(PiADLADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.piadladmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(PiADLADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.piadladmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentPortMappingSource5CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ComponentPortMappingSource5CreationTool_title,
				Messages.ComponentPortMappingSource5CreationTool_desc,
				Collections
						.singletonList(PiADLADManagementMetamodelElementTypes.ComponentPortMappingSource_4047));
		entry.setId("createComponentPortMappingSource5CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(PiADLADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.piadladmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(PiADLADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.piadladmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentPortMappingTarget6CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ComponentPortMappingTarget6CreationTool_title,
				Messages.ComponentPortMappingTarget6CreationTool_desc,
				Collections
						.singletonList(PiADLADManagementMetamodelElementTypes.ComponentPortMappingTarget_4049));
		entry.setId("createComponentPortMappingTarget6CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(PiADLADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.piadladmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(PiADLADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.piadladmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createConnectorRoleMappingSource7CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ConnectorRoleMappingSource7CreationTool_title,
				Messages.ConnectorRoleMappingSource7CreationTool_desc,
				Collections
						.singletonList(PiADLADManagementMetamodelElementTypes.ConnectorRoleMappingSource_4045));
		entry.setId("createConnectorRoleMappingSource7CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(PiADLADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.piadladmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(PiADLADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.piadladmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createConnectorRoleMappingTarget8CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ConnectorRoleMappingTarget8CreationTool_title,
				Messages.ConnectorRoleMappingTarget8CreationTool_desc,
				Collections
						.singletonList(PiADLADManagementMetamodelElementTypes.ConnectorRoleMappingTarget_4050));
		entry.setId("createConnectorRoleMappingTarget8CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(PiADLADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.piadladmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(PiADLADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.piadladmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private static class NodeToolEntry extends ToolEntry {

		/**
		 * @generated
		 */
		private final List/*[org.eclipse.gmf.runtime.emf.type.core.IElementType]*/elementTypes;

		/**
		 * @generated
		 */
		private NodeToolEntry(
				String title,
				String description,
				List/*[org.eclipse.gmf.runtime.emf.type.core.IElementType]*/elementTypes) {
			super(title, description, null, null);
			this.elementTypes = elementTypes;
		}

		/**
		 * @generated
		 */
		public Tool createTool() {
			Tool tool = new UnspecifiedTypeCreationTool(elementTypes);
			tool.setProperties(getToolProperties());
			return tool;
		}
	}

	/**
	 * @generated
	 */
	private static class LinkToolEntry extends ToolEntry {

		/**
		 * @generated
		 */
		private final List/*[org.eclipse.gmf.runtime.emf.type.core.IElementType]*/relationshipTypes;

		/**
		 * @generated
		 */
		private LinkToolEntry(
				String title,
				String description,
				List/*[org.eclipse.gmf.runtime.emf.type.core.IElementType]*/relationshipTypes) {
			super(title, description, null, null);
			this.relationshipTypes = relationshipTypes;
		}

		/**
		 * @generated
		 */
		public Tool createTool() {
			Tool tool = new UnspecifiedTypeConnectionTool(relationshipTypes);
			tool.setProperties(getToolProperties());
			return tool;
		}
	}
}
